home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / PPPMonitor1.16 / Source / ExecRunCommand.h < prev    next >
Text File  |  1996-01-29  |  3KB  |  59 lines

  1. // -------------------------------------------------------------------------------------
  2. // ExecRunCommand.h
  3. // (Indent:4, Tabs:4)
  4. // -------------------------------------------------------------------------------------
  5. // Copyright 1996 Persistent Technologies, Inc. - all rights reserved
  6. // -------------------------------------------------------------------------------------
  7. // This source code comes with no warranty of any kind, and the user assumes all 
  8. // responsibility for its use.
  9. // -------------------------------------------------------------------------------------
  10. #import <objc/Object.h>
  11.  
  12. // -------------------------------------------------------------------------------------
  13. // errors passed by 'commandDidComplete:withError:' via 'runCommand:...'
  14. // Note: these codes may be shared by the running command which executes an exit(#)
  15. #define            RUNCMD_STOPPED            0x100    // command stopped/aborted
  16. #define            RUNCMD_SUCCESS            0x000    // executed/completed successfully
  17. #define            RUNCMD_USER                0x0FF    // (255) cannot switch to user
  18. #define            RUNCMD_EXEC                0x07F    // (127) cannot execute execl shell
  19.  
  20. /* ExecRunCommand delegate */
  21. @protocol ExecRunCommand_Delegate
  22. - (void)commandOutput:(id)execId buffer:(const char*)buffer len:(int)len;
  23. - (void)commandDidComplete:(id)execId withError:(int)errorCode;
  24. @end
  25.  
  26. // -------------------------------------------------------------------------------------
  27. // Command execution controller
  28. @interface ExecRunCommand : Object
  29. {
  30.     int                    cmdChild;                    // command execution
  31.     int                    inputDescriptor;            // input pipe
  32.     id                    delegate;                    // delegate
  33.     int                    tag;                        // tag
  34. }
  35. + runCommand:(const char*)command user:(const char*)user output:(id)theDelegate;
  36. + runCommand:(const char*)command output:(id)theDelegate;
  37. + (int)system:(const char*)command user:(const char*)user output:(id)theDelegate;
  38. + (int)system:(const char*)command user:(const char*)user;
  39. + (int)system:(const char*)command;
  40. - setTag:(int)tag;
  41. - (int)tag;
  42. - (BOOL)isActive;
  43. - setDelegate:(id)theDelegate;
  44. - (id)delegate;
  45. - interruptCommand;
  46. - terminateCommand;
  47. - killCommand;
  48. // -------------------------------------------------------------------------------------
  49. + (BOOL)isRunningAsRoot;
  50. //  returns true if effective user is 'root'
  51. //
  52. // -------------------------------------------------------------------------------------
  53. - (void)commandOutput:(const char*)buffer len:(int)len;
  54. - (void)commandDidCompleteWithError:(int)errorCode;
  55. //  Provides support for ExecServer.
  56. //
  57. // -------------------------------------------------------------------------------------
  58. @end
  59.